package com.cnswhy.cloud.common.rabbitmq.model;

import com.alibaba.fastjson.JSON;
import lombok.Data;

@Data
public class DLXMessage {

    private String exchange;
    private String queueName;
    private String content;
    private long times;
    private Class clazz;

    public DLXMessage(String queueName, String content, long times) {
        super();
        this.queueName = queueName;
        this.content = content;
        this.times = times;
    }

    public DLXMessage(String exchange, String queueName, String content,Class clazz, long times) {
        super();
        this.exchange = exchange;
        this.queueName = queueName;
        this.content = content;
        this.times = times;
        this.clazz = clazz;
    }

    public static void main(String[] args) {
        String msg = "{\"exchange\":\"SEND_MESSAGE_QUERY\",\"content\":{\"bizId\":\"352721703963095864^0\",\"mobile\":\"18826426221\",\"queryTimes\":0,\"smsType\":\"SMS_CODE\",\"templateCode\":\"SMS_200310059\",\"traceId\":\"b580da8a2151423883b1f5071a3fdba4\",\"verifyCode\":\"7732\"},\"queueName\":\"SEND_MESSAGE_QUERY_QUEUE\",\"times\":10000}";
        System.out.println(msg);
        DLXMessage dlxMessage = JSON.parseObject(msg,DLXMessage.class);
        System.out.println(dlxMessage.getContent());
        System.out.println(JSON.toJSON(dlxMessage));

    }
}
